40ae15a82533d4d16e8646d354fff8e5a9280c87,src/main/java/betterquesting/client/gui/editors/json/GuiJsonItemSelection.java,GuiJsonItemSelection,drawScreen,#number#number#number#,120
Before Change
BigItemStack ttStack = null;
int btnWidth = sizeX/2 - 16;
GL11.glColor4f(1f, 1f, 1f, 1f);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("betterquesting.gui.selection"), guiLeft + 24, guiTop + 36, ThemeRegistry.curTheme().textColor().getRGB(), false);
this.fontRendererObj.drawString("x", guiLeft + 64, guiTop + 52, ThemeRegistry.curTheme().textColor().getRGB(), false);
GL11.glColor4f(1f, 1f, 1f, 1f);
this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture());
GL11.glPushMatrix();
GL11.glScalef(2F, 2F, 1F);
this.drawTexturedModalRect((guiLeft + 24)/2, (guiTop + 48)/2, 0, 48, 18, 18);
if(this.stackSelect != null)
{
RenderUtils.RenderItemStack(this.mc, this.stackSelect.getBaseStack(), (guiLeft + 26)/2, (guiTop + 50)/2, "");
if(this.isWithin(mx, my, 25, 49, 32, 32))
{
ttStack = this.stackSelect;
}
}
GL11.glPopMatrix();
fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), this.guiLeft + 24, this.guiTop + sizeY/2 - 12, ThemeRegistry.curTheme().textColor().getRGB(), false);
GL11.glColor4f(1F, 1F, 1F, 1F);
if(this.mc.thePlayer != null)
{
ItemStack[] invoStacks = this.mc.thePlayer.inventory.mainInventory;
int isx = (18 * 9);
int isy = (18 * 4);
float scale = Math.max((btnWidth - 16)/(float)isx, (sizeY/2 - 32)/isy);
int ipx = guiLeft + 16 + btnWidth/2 - (int)(isx/2*scale);
int ipy = guiTop + sizeY/2;
GL11.glPushMatrix();
GL11.glTranslatef(ipx, ipy, 0F);
GL11.glScalef(scale, scale, 1F);
for(int i = 0; i < invoStacks.length && i < 9 * 4; i++) // Intentionally limited to vanilla size for UI neatness
{
int x = i%9 * 18;
int y = (i - i%9)/9 * 18;
this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture());
GL11.glDisable(GL11.GL_DEPTH_TEST);
this.drawTexturedModalRect(x, y, 0, 48, 18, 18);
GL11.glEnable(GL11.GL_DEPTH_TEST);
ItemStack stack = invoStacks[i];
if(stack != null)
{
RenderUtils.RenderItemStack(mc, stack, x + 1, y + 1, "" + (stack.stackSize > 1? stack.stackSize : ""));
if(isWithin(mx, my, ipx + (int)((x + 1)*scale), ipy + (int)((y + 1)*scale), (int)(16*scale), (int)(16*scale), false))
{
ttStack = new BigItemStack(stack);
}
}
}
GL11.glPopMatrix();
}
RenderUtils.DrawLine(width/2, guiTop + 32, width/2, guiTop + sizeY - 32, 2F, ThemeRegistry.curTheme().textColor());
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("betterquesting.gui.search"), guiLeft + sizeX/2 + 8, guiTop + 36, ThemeRegistry.curTheme().textColor().getRGB(), false);
int mxPage = Math.max(MathHelper.ceiling_float_int(searchResults.size()/(float)(columns * rows)), 1);
this.fontRendererObj.drawString((searchPage + 1) + "/" + mxPage, guiLeft + 16 + (sizeX - 32)/4*3, guiTop + sizeY - 42, ThemeRegistry.curTheme().textColor().getRGB(), false);
this.searchBox.drawTextBox();
this.numberBox.drawTextBox();
GL11.glColor4f(1f, 1f, 1f, 1f);
int x = 0;
int y = 0;
for(int i = (columns * rows * searchPage); i < searchResults.size(); i++)
{
int n = i - (columns * rows * searchPage);
x = n%columns * 18;
y = (n - n%columns)/columns * 18;
if(y > this.sizeY - (48 + 48 + 18))
{
break;
}
this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture());
ItemStack resultStack = searchResults.get(i);
if(resultStack != null)
{
GL11.glDisable(GL11.GL_DEPTH_TEST);
this.drawTexturedModalRect(guiLeft + sizeX/2 + x + 8, guiTop + 48 + y, 0, 48, 18, 18);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderUtils.RenderItemStack(mc, resultStack, guiLeft + sizeX/2 + 9 + x, guiTop + 49 + y, "");
if(this.isWithin(mx, my, this.sizeX/2 + x + 9, 49 + y, 16, 16))
{
ttStack = new BigItemStack(resultStack);
}
}
}
if(ttStack != null)
{
GL11.glPushMatrix();
this.drawHoveringText(ttStack.getBaseStack().getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips), mx, my, this.fontRendererObj);
GL11.glColor4f(1f, 1f, 1f, 1f);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
After Change
BigItemStack ttStack = null;
int btnWidth = sizeX/2 - 16;
GlStateManager.color(1f, 1f, 1f, 1f);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("betterquesting.gui.selection"), guiLeft + 24, guiTop + 36, ThemeRegistry.curTheme().textColor().getRGB(), false);
this.fontRendererObj.drawString("x", guiLeft + 64, guiTop + 52, ThemeRegistry.curTheme().textColor().getRGB(), false);
GlStateManager.color(1f, 1f, 1f, 1f);
this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture());
GlStateManager.pushMatrix();
GlStateManager.scale(2F, 2F, 1F);
this.drawTexturedModalRect((guiLeft + 24)/2, (guiTop + 48)/2, 0, 48, 18, 18);
if(this.stackSelect != null)
{
RenderUtils.RenderItemStack(this.mc, this.stackSelect.getBaseStack(), (guiLeft + 26)/2, (guiTop + 50)/2, "");
if(this.isWithin(mx, my, 25, 49, 32, 32))
{
ttStack = this.stackSelect;
}
}
GlStateManager.popMatrix();
fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), this.guiLeft + 24, this.guiTop + sizeY/2 - 12, ThemeRegistry.curTheme().textColor().getRGB(), false);
GlStateManager.color(1F, 1F, 1F, 1F);
if(this.mc.thePlayer != null)
{
ItemStack[] invoStacks = this.mc.thePlayer.inventory.mainInventory;
int isx = (18 * 9);
int isy = (18 * 4);
float scale = Math.max((btnWidth - 16)/(float)isx, (sizeY/2 - 32)/isy);
int ipx = guiLeft + 16 + btnWidth/2 - (int)(isx/2*scale);
int ipy = guiTop + sizeY/2;
GlStateManager.pushMatrix();
GlStateManager.translate(ipx, ipy, 0F);
GlStateManager.scale(scale, scale, 1F);
for(int i = 0; i < invoStacks.length && i < 9 * 4; i++) // Intentionally limited to vanilla size for UI neatness
{
int x = i%9 * 18;
int y = (i - i%9)/9 * 18;
this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture());
GlStateManager.disableDepth();
this.drawTexturedModalRect(x, y, 0, 48, 18, 18);
GlStateManager.enableDepth();
ItemStack stack = invoStacks[i];
if(stack != null)
{
RenderUtils.RenderItemStack(mc, stack, x + 1, y + 1, "" + (stack.stackSize > 1? stack.stackSize : ""));
if(isWithin(mx, my, ipx + (int)((x + 1)*scale), ipy + (int)((y + 1)*scale), (int)(16*scale), (int)(16*scale), false))
{
ttStack = new BigItemStack(stack);
}
}
}
GlStateManager.popMatrix();
}
RenderUtils.DrawLine(width/2, guiTop + 32, width/2, guiTop + sizeY - 32, 2F, ThemeRegistry.curTheme().textColor());
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("betterquesting.gui.search"), guiLeft + sizeX/2 + 8, guiTop + 36, ThemeRegistry.curTheme().textColor().getRGB(), false);
int mxPage = Math.max(MathHelper.ceiling_float_int(searchResults.size()/(float)(columns * rows)), 1);
this.fontRendererObj.drawString((searchPage + 1) + "/" + mxPage, guiLeft + 16 + (sizeX - 32)/4*3, guiTop + sizeY - 42, ThemeRegistry.curTheme().textColor().getRGB(), false);
this.searchBox.drawTextBox();
this.numberBox.drawTextBox();
GlStateManager.color(1f, 1f, 1f, 1f);
int x = 0;
int y = 0;
for(int i = (columns * rows * searchPage); i < searchResults.size(); i++)
{
int n = i - (columns * rows * searchPage);
x = n%columns * 18;
y = (n - n%columns)/columns * 18;
if(y > this.sizeY - (48 + 48 + 18))
{
break;
}
this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture());
ItemStack resultStack = searchResults.get(i);
if(resultStack != null)
{
GlStateManager.disableDepth();
this.drawTexturedModalRect(guiLeft + sizeX/2 + x + 8, guiTop + 48 + y, 0, 48, 18, 18);
GlStateManager.enableDepth();
RenderUtils.RenderItemStack(mc, resultStack, guiLeft + sizeX/2 + 9 + x, guiTop + 49 + y, "");
if(this.isWithin(mx, my, this.sizeX/2 + x + 9, 49 + y, 16, 16))